package org.cnc.core;

import org.cnc.core.DetailModel.ModelState;

public class ModelBuilder {
	
	public static int PADDING = 5;
	public static int canvasSize = 30;
	
	public ModelBuilder()
	{
		
	}
	
	public DetailModel buildModelByXYZ ( int x, int y, int z )
	{
		DetailModel model = new DetailModel( canvasSize - 2*PADDING, canvasSize );
		
		int yFirst, yLast, xFirst, xLast, zFirst, zLast;

		/* CENTER */
		//xFirst = (canvasSize - x)/2; xLast = canvasSize - xFirst + 1;
		//zFirst = (canvasSize - z + 1)/2; zLast = canvasSize - zFirst + 1;
		
		/* FROM CORNER */
		xFirst = PADDING; xLast = PADDING + x ;
		
		zFirst = canvasSize/2 - (z + ( z % 2 ) )/2; zLast = canvasSize/2 + (z)/2;
		
		yFirst = canvasSize - 2*PADDING - y; yLast = canvasSize - 2*PADDING;
		
		for ( int yk = yFirst; yk < yLast; yk++ )
		{
			for ( int xk = xFirst; xk < xLast; xk++ )
			{
				for ( int zk = zFirst; zk < zLast; zk ++ )
				{
					model.detailModel[xk][yk][zk] = ModelState.CUTTER;
				}
			}
		}
		
		return model;
	}
	

}
